<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div class="top-number">
      {{ getIndex }}
    </div>
    <img class="outline-parent-bg" :src="publicUrls + 'free/style3/Level1outlineStyle1Bg.webp'" alt="" />
    <div class="content">
      <div class="title-box">
        <p v-html="textType(props.info.text)"></p>
      </div>
      <p class="subtitle">
        {{ props.info.subTitle }}
      </p>
      <div class="solid-parent">
        <div class="digitalShowroom-p" v-if="props.info.digitalShowroom">
          <!-- digitalShowroom -->
          <digitalShowroomIcon :url="props.info.digitalShowroom" />
        </div>
        <img class="solid" :src="publicUrls + 'free/style3/Level1outlineStyle1xt.webp'" alt="" />
      </div>
      <div class="img-box" v-if="props.info.value">
        <img
          class="outline-cover"
          @click="ImgVisible = true"
          :src="urls + props.info.value + '?imageView2/3/format/webp'"
          alt=""
        />
        <div class="radio1 radio"></div>
        <div class="radio2 radio"></div>
        <div class="radio3 radio"></div>
        <div class="radio4 radio"></div>
      </div>
      <div class="remarks1" v-if="props.info.value">
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="5"
        ></TextMax>
      </div>
      <div class="remarks2" v-else>
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="10"
        ></TextMax>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free3Style1',
});
</script>

<script setup lang="ts">
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style1.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax3.vue';
import { useProjectStore } from '@/store';

const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
const getIndex = computed(() => {
  let index = 0;
  const num = ['壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖', '拾', '拾壹', '拾贰', '拾叁', '拾肆', '拾伍'];
  store.templateMOdeList.forEach((el, indexs) => {
    if (el.id === props.info.id) {
      index = indexs;
    }
  });
  return num[index];
});
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 200px;
  // margin-left: 120px;
  margin-top: 0;
}
.outline-parent-bg {
  width: 490px;
  height: 100%;
}

.top-number {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 56px;
  max-width: 94px;
  height: 64px;
  background: #e6cfa5;
  border: 4px solid #dbbd6e;
  font-family: SourceBold;

  font-size: 38px;
  color: #877034;
  line-height: 55px;
  text-align: left;
  font-style: normal;
}
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute;
  width: 388px;
  top: 132px;
  //   left: 50%;
  left: 46.2px;
}
.title-box {
  display: flex;
  align-items: center;
  width: 256px;
  height: 80px;
  margin-bottom: 16px;
  :deep(p) {
    width: 256px;

    font-family: SourceBold;
    font-size: 32px;
    color: #2f1b16;
    line-height: 40px;
    text-align: center;
  }
}
.subtitle {
  width: 320px;
  height: 48px;
  font-family: SourceMedium;
  font-size: 18px;
  color: #2f1b16;
  line-height: 24px;
  text-align: center;
  margin-bottom: 22px;
  opacity: 0.5;
}
.solid-parent {
  position: relative;
  width: 100%;
  height: auto;
  .digitalShowroom-p {
    width: 46px;
    height: 46px;
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
  }
}
.solid {
  width: 100%;
  height: auto;
}
.img-box {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 320px;
  height: 180px;
  background: #623333;
  margin-top: 48px;
  // border-radius: 8px;
}
.outline-cover {
  height: 180px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  transition: all 0.3s;
}
.outline-cover:hover {
  transform: scale(1.2);
}
.radio {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e1dbcf;
  z-index: 6;
}
.radio1 {
  top: -8px;
  left: -8px;
}
.radio2 {
  top: -8px;
  right: -8px;
}
.radio3 {
  bottom: -8px;
  left: -8px;
}
.radio4 {
  bottom: -8px;
  right: -8px;
}
.remarks1 {
  width: 320px;
  margin-top: 32px;
}
.remarks2 {
  width: 320px;
  margin-top: 64px;
}
</style>
